<template>
	<div class="subpage helppay" style="position: absolute;">
		<div class="help-wrap">
			<div v-if="this.$route.query.fromView !== 'order'">
				<div class="address-box">
					<div class="address" @click="toAddress" v-if="Object.keys(this.firstList).length == 0">
						<div class="head clearfix">
							<p class="address-icon">
								<van-icon name="location-o" size="26px" color="#969C9E" tag="i" /><span>暂无收货地址</span>
							</p>
							<p class="add-text">
								<span>添加地址</span>
								<van-icon name="arrow" class="arrow-right" size="15px" color="#CDCDCD" tag="i" />
							</p>
						</div>
					</div>
					<div class="has-address" @click="toAddress" v-else>
						<div class="has-haed">
							<p class="icon">
								<van-icon name="location-o" size="26px" color="#969C9E" tag="i" />
							</p>
							<div class="province">
								<p class="name">
									<span class="ellipsis">{{firstList.name}}</span>
									<span class="ellipsis">{{firstList.tel}}</span>
								</p>
								<p class="text">{{firstList.province}}&nbsp; {{firstList.city}}&nbsp; {{firstList.county}} &nbsp;{{firstList.addressDetail}}</p>
							</div>
							<p class="has-text"><span>修改地址</span>
								<van-icon name="arrow" size="15px" color="#CDCDCD" tag="i" />
							</p>
						</div>
					</div>
				</div>
				<div class="help-main">
					<div class="main-inner">
						<div class="pro-img">
							<img :src="itemObj.smallPic">
						</div>
						<div class="pro-text">
							<span class="baoyou">{{itemObj.saleType}}{{itemObj.postage}}</span>
							<span class="des">{{itemObj.aidDetail}}</span>
							<p class="sub-des">{{itemObj.aidDescript}}</p>
						</div>
					</div>
					<div class="pro-grade">
						<p class="p1">
							等级：{{superData.level}}
							<!-- <span class="down" @click="downClick"></span> -->
						</p>
						<p class="p2"><span class="weight">重量：{{superData.weight}}{{superData.weightUnit}}</span><span class="ospan">最低订货量：{{superData.minOrderQuantity}}{{superData.minOrderQuantityUnit}}</span></p>
						<p class="p3"><span>规格：{{superData.specs}}</span><span>包装：{{superData.packing}}</span></p>
					</div>
					<div class="placeoforigin">
						<div class="title-box">
							<span class="title">产地</span>
							<span class="name">
								<van-icon name="location-o" size="18px" color="#969C9E" tag="i" />{{itemObj.originProvince}}·{{itemObj.originCity}}</span>
						</div>
					</div>
				</div>
				<div class="cus-box">
					<ul class="cus-list">
						<li class="first-li">
							<span class="price"><i>{{price}}</i>元/{{isPot}}</span>
							<p>
								<span class="cus-right" v-if="isPot == '罐'">
									<em :class="active == 0 ? 'addclass' : '' " @click='selectType(0, 20000)'>2万</em>
									<em :class="active == 1 ? 'addclass' : '' " @click='selectType(1, 10000)'>1万</em>
									<em :class="active == 2 ? 'addclass' : '' " @click='selectType(2, 5000)'>5千</em>
								</span>
								<span class="cus-right" v-else>
									<em :class="active == 0 ? 'addclass' : '' " @click='selectType(0, 1000)'>1千</em>
									<em :class="active == 1 ? 'addclass' : '' " @click='selectType(1, 500)'>500</em>
									<em :class="active == 2 ? 'addclass' : '' " @click='selectType(2, 334)'>334</em>
								</span>
								<span class="stepper">
									<van-stepper :min="superData.minOrderQuantity" :max="superData.maxOrderQuantity" v-model="value" @plus="addAction"
									 @minus="minusdAction" @focus="onfocus" /></span>
							</p>
						</li>
						<li>
							<span class="cus-left">总金额</span>
							<span class="cus-right"><i>{{product.product.totalPrice}}元</i></span>
						</li>
						<li class="flex-wl">
							<span class="cus-left">配送方式</span>
							<span class="cus-right">顺丰物流</span>
							<span class="wl-text" @click="meatTips">物流说明
								<van-icon name="arrow" size="14px" color="#CDCDCD" tag="i" /></span>
						</li>
						<li>
							<span class="cus-left">物流费用</span>
							<span class="cus-right"><i>0元</i></span>
						</li>
						<!-- <li>
							<span class="cus-left">配送时间</span>
							<span class="cus-right">下单后3天发货</span>
						</li> -->
					</ul>
				</div>
			</div>
			<pay-com :superData="superData" v-else></pay-com>
			<div class="zf-box">
				<div class="zf-wrap">
					<h2>支付方式</h2>
				</div>
				<div class="cell-zf">
					<div class="left">
						<!-- 余额支付 -->
						<div class="left-box">
							<img src="@/assets/img/home_img29.png" alt="" style="margin-top: 14px;">
							<span class="wechart">余额支付</span>
							<i class="ye-money">{{accountMoney}}元</i>
						</div>
						<span class="radio" style="margin-top: 16px;">
							<div class="chenboxaa" @click="isCheckedClick3" v-if="isChecked3">
								<van-icon name="checked" color="#31BC8D" size="22px" />
							</div>
							<div class="chenboxaa" @click="isCheckedClick3" v-else>
								<van-icon name="circle" color="#999" size="22px" />
							</div>
						</span>
					</div>
				</div>
				<div class="cell-zf">
					<div class="left">
						<!-- 微信支付 -->
						<div class="left-box">
							<img src="@/assets/img/wechart.png" alt="">
							<span class="wechart">微信支付</span>

						</div>
						<span class="radio">
							<div class="chenboxaa" @click="isCheckedClick2" v-if="isChecked2">
								<van-icon name="checked" color="#31BC8D" size="22px" />
							</div>
							<div class="chenboxaa" @click="isCheckedClick2" v-else>
								<van-icon name="circle" color="#999" size="22px" />
							</div>
						</span>
					</div>
				</div>
				<div class="cell-zf">
					<div class="left" style="justify-content: start;">
						<span class="radio">
							<!-- 阅读且同意 -->
							<div class="chenboxaa" @click="isCheckedClick" v-if="isChecked">
								<van-icon name="checked" color="#31BC8D" size="22px" />
							</div>
							<div class="chenboxaa" @click="isCheckedClick" v-else>
								<van-icon name="circle" color="#999" size="22px" />
							</div>
						</span>
						<span class="wechart" style="margin-left: 16px;" @click="toAgaricPurchaseAgreement">阅读且同意 <i style="color: #31BC8D;">《友牧农场服务协议》</i></span>
					</div>
				</div>
			</div>
		</div>
		<div class="footer">

			<p class="total" v-if="this.$route.query.fromView !== 'order'"><span>共{{value}}{{isPot}}</span><span class="totalMoney">合计：{{product.product.totalPrice}}元</span></p>

			<p class="total" v-else><span>共{{superData.orderQuantity}}{{isPot}}</span><span class="totalMoney">合计：{{superData.payMoney}}元</span></p>

			<van-button round class="u-btn-default bind-btn" @click="keepSave">立即支付</van-button>

		</div>
		<!--  交易密码框 -->
		<van-overlay :show="YEpayoverlay" />
		<div class="YEpayoverlay" v-show="YEpayoverlay">
			<div class="pay-head">输入交易密码</div>
			<div class="pass-box">
				<!-- 密码输入框 -->
				<van-password-input :value="valuepass" :focused="showKeyboard" @focus="showKeyboard = true" />
				<!-- 数字键盘 -->
				<van-number-keyboard :show="showKeyboard" @input="onInput" @delete="onDelete" @blur="showKeyboard = false" />
			</div>
			<div class="pass-footer">
				<van-button round class="u-btn-default bind-btn pass-btn" @click="keepPass">确认</van-button>
			</div>

		</div>

		<div class="meat-alert-container" v-if="meatTipsFlag">
			<div class="meat-alert-box">
				<div class="meat-alert-box-top">物流说明</div>
				<div class="meat-alert-box-center">
					<p>{{itemObj.shipmentDetail}}</p>
				</div>
				<div class="color-primary meat-alert-box-bottom" @click="meatTipsFlag = false">知道啦</div>
			</div>
		</div>


		<!-- 设置数量 -->
		<van-overlay :show="isOverlay" />
		<div class="isOverlay" v-show="isOverlay">
			<div class="overlay-head">
				选择购买数量
				<van-icon name="cross" color="#31BC8D" tag="i" @click="hideOverlay"/>
			</div>
			<div class="overlay-content">
				<p>
					*最低购买量{{superData.minOrderQuantity}}{{isPot}}起*
				</p>
				<div class="overlay-input">
					<input class="input" ref="re" autofocus="true" type="text" placeholder="请输入购买数量" v-model="amount" style="width: 100%;border-bottom: 1px solid #f2f2f2;"  />
				</div>
				<div class="overlay-btn">
					<van-button round class="u-btn-default bind-btn" @click="comfirmPrice">确认</van-button>
				</div>
			</div>
		</div>

		<!--  交易密码框 -->
		<van-overlay :show="YEpayoverlay" />
		<!-- 数字键盘 -->
		<van-number-keyboard :show="YEpayoverlay" @input="onInput" @delete="onDelete" @blur="showKeyboard = false" />
		<div class="YEpayoverlay" v-show="YEpayoverlay">
			<div class="pay-head">输入交易密码
				<van-icon name="cross" color="#31BC8D" size="20" tag="i" @click="hideKeyborard" />
			</div>
			<div class="pass-box">
				<!-- 密码输入框 -->
				<van-password-input :value="over_payData.payPwd" :focused="showKeyboard" @focus="showKeyboard = true" />
			</div>
			<div class="pass-footer">
				<van-button round class="u-btn-default bind-btn pass-btn" @click="keepPass">确认</van-button>
			</div>
		</div>
	</div>
</template>

<script>
	import PayCom from '../components/PayCom.vue';
	import Storage from "@/utils/storage";
	import { mapState, mapMutations, mapActions, mapGetters } from 'vuex';
	import Vue from 'vue'
	import { Stepper, PasswordInput, NumberKeyboard, Overlay, Popup } from 'vant';
	Vue.use(Stepper).use(PasswordInput).use(NumberKeyboard).use(Overlay).use(Popup)
	export default {
		components: {
			PayCom
		},
		data() {
			return {
				gradeId: '',
				id: '',
				superData: {},
				itemObj: {
					smallPic: ''
				},
				showKeyboard: true,
				YEpayoverlay: false,
				amount: '',
				isOverlay: false,
				show: false,
				active: 2,
				isChecked: false, // 协议
				isChecked2: false, // 微信支付
				isChecked3: false, // 余额支付
				valuepass: '',
				firstList: {

				},
				value: '',
				accountMoney: '', // 钱包余额
				price: '',
				meatTipsFlag: false,
				over_payData: { // 余额支付
					orderId: '',
					payPwd: '' //
				},
				postData: {
					addressId: '',
					fungusCategoryId: '',
					quantity: ''
				},
				p: '',
				fromViewId: '',
				isPot: '', // 从详情页传过来的标识符， 罐。箱
				addressId: '',
				
			}
		},
		computed: {
			...mapState([
				'product',
				'user'
			])
		},
		watch: {
			//  监听value变化  计算
			value: function(newVal, oldVal) {
				this.postData.quantity = newVal; //  数量
				let price = Number(this.value) * Number(this.price * 1); // 牛肉费用  数量 * 单价
				// 如果有两位小数，去掉第二位小数，第一位小数 +0.1
				price = Math.floor(price * 100) / 100;
				let y = String(price).indexOf(".") + 1; //获取小数点的位置
				let counts = String(price).length - y; //获取小数点后的个数
				if (counts > 1 && y !== 0) { // 小数点的位置不能 == 0 小数点个数要大于1
					console.log("这个数字是小数，有" + counts + "位小数");
					price = Math.floor(price * 10) / 10;
					price = price + 0.1;
					price = Math.floor(price * 100) / 100;
				}
				this.$store.commit('totalPrice', price);
				//  监听数量选择状态  
				console.log(newVal)
				if (this.isPot == '罐') {
					switch (newVal) {
						case 5000:
							this.active = 2;
							Storage.set('count', this.value);
							break;
						case 10000:
							this.active = 1;
							Storage.set('count', this.value);
							break;
						case 20000:
							this.active = 0;
							Storage.set('count', this.value);
							break;
						default:
							this.active = -1;
					}
				} else {
					switch (newVal) {
						case 334:
							this.active = 2;
							Storage.set('count', this.value);
							break;
						case 500:
							this.active = 1;
							Storage.set('count', this.value);
							break;
						case 1000:
							this.active = 0;
							Storage.set('count', this.value);
							break;
						default:
							this.active = -1;
					}
				}

			},
			price: function(newVal, oldVal) {
				let price = Number(this.value) * Number(newVal * 1); // 牛肉费用  数量 * 单价
				// 如果有两位小数，去掉第二位小数，第一位小数 +0.1
				price = Math.floor(price * 100) / 100;
				let y = String(price).indexOf(".") + 1; //获取小数点的位置
				let counts = String(price).length - y; //获取小数点后的个数
				if (counts > 1 && y !== 0) { // 小数点的位置不能 == 0 小数点个数要大于1
					console.log("这个数字是小数，有" + counts + "位小数");
					price = Math.floor(price * 10) / 10;
					price = price + 0.1;
					price = Math.floor(price * 100) / 100;
				}
				this.$store.commit('totalPrice', price)
			},
			amount: function(val) {
				this.amount = val.replace(/\D/g, ''); // 将非数字的替换为空
			}
		},
		created() {
			if (this.$route.query.fromView == 'order') {
				this.fromViewId = this.$route.params.id;
				this.saveStatus()
				this.getFromViewData() // 订单详情
			} else {
				this.saveStatus() // 初始化函数
				this.getDetailData() // 木耳详情页
				if(Storage.get('addressId')){   // 地址接口
					this.getAddressListById()  
				} else {
					this.getAddressList();
				}
			}
			this.getUserData() // 用户数据
		},
		mounted(){
			this.$tool.addEventListenerInputFocusout()
		},
		methods: {
			// 订单详情
			getFromViewData() {
				this.$api.get('/api/fungus_order/detail/' + this.fromViewId)
					.then((res) => {
						console.log(res)
						this.superData = res.data;
						this.postData.fungusCategoryId = res.data.id;
					})
			},
			// 木耳详情页
			getDetailData() {
				this.$api.get('/api/fungus/product_detail/' + this.id)
					.then(({ data }) => {
						console.log(data)
						this.itemObj = data;
						data.fungusCategories.map(item => {
							if (item.id == this.gradeId) {
								this.superData = item;
								this.price = item.salePrice;
								this.postData.fungusCategoryId = item.id;
							}
						})
					})
			},
			// 初始化函数
			saveStatus() {
				this.id = this.$route.params.id;
				this.gradeId = this.$route.query.gradeId; // 通过传这个id 才能知道传的是哪个等级
				this.isPot = this.$route.query.isPot;
				if (this.isPot == '箱') {
					this.postData.quantity = 334; //  数量
					this.value = 334;
				} else {
					this.postData.quantity = 5000; //  数量
					this.value = 5000;
				}
				if (Storage.get('count')) {
					this.value = Number(Storage.get('count'))
				}
				// 在这里获取选中支付状态渲染
				if (Storage.get('checkedYE')) {
					this.isChecked3 = JSON.parse(Storage.get('checkedYE'));
				}
				if (Storage.get('checkedZF')) {
					this.isChecked2 = JSON.parse(Storage.get('checkedZF'));
				}
				if (Storage.get('checkedXY')) {
					this.isChecked = JSON.parse(Storage.get('checkedXY'));
				}
				//  选择数量状态
				if (Storage.get('addclass')) {
					this.active = JSON.parse(Storage.get('addclass'));
				}
				if(Storage.get('addressId')){
					this.addressId = Storage.get('addressId');
				}
			},
			// 交易密码确认
			keepPass() {
				if (Storage.get('checkedYE')) {
					if (this.over_payData.payPwd.length == 0) {
						this.$tool.toast('请输入密码')
						return
					} else if (this.over_payData.payPwd.length < 6) {
						this.$tool.toast('请输入6位数密码')
						return
					}
					this.over_payData.payPwd = this.$md5(this.over_payData.payPwd); // 加密密码 md5
					console.log(this.over_payData)
					//调余额支付方法
					this.over_pay()
				}
			},
			onInput(key) {
				this.over_payData.payPwd = (this.over_payData.payPwd + key).slice(0, 6);
			},
			onDelete() {
				this.over_payData.payPwd = this.over_payData.payPwd.slice(0, this.over_payData.payPwd.length - 1);
			},
			// 余额支付
			isCheckedClick3() {
				this.isChecked3 = !this.isChecked3;
				this.isChecked2 = false
				Storage.set('checkedYE', this.isChecked3) //  存储 状态  同上
				Storage.del('checkedZF', this.isChecked2) //  存储 状态  同上
			},
			// 微信支付
			isCheckedClick2() {
				this.isChecked2 = !this.isChecked2;
				this.isChecked3 = false;
				Storage.set('checkedZF', this.isChecked2) //  存储 状态  同上
				Storage.del('checkedYE', this.isChecked) //  存储 状态  同上
			},
			isCheckedClick() {
				this.isChecked = !this.isChecked;
				Storage.set('checkedXY', this.isChecked) //  存储 状态  同上
			},
			selectType(index, value) {
				this.active = index;
				Storage.set('addclass', index)
				switch (index) {
					case 0:
						this.value = value;
						break;
					case 1:
						this.value = value;
						break;
					case 2:
						this.value = value;
						break;
				}
			},
			// 获取地址列表接口
			getAddressList() {
				this.$api.post('/api/user/getaddresslist')
					.then(({ data
					}) => {
						if (data.length > 0) {
							this.firstList = data[0];
							this.postData.addressId = data[0].id; // 地址id
						}
					})
			},
			// 根据id获取地址
			getAddressListById(){
				this.$api.get('/api/user/getAddressById/' + this.addressId)
				.then(({data})=>{
					this.firstList = data;
					this.postData.addressId = data.id;  // 地址id
					console.log(data)
				})
			},
			toAddress() {
				// 判断 是否有地址数据，有的话跳转到  地址列表页面，没有跳转到新增页面  es6语法
				if (Object.keys(this.firstList).length == 0) {
					this.$router.push({
						path: '/home/address/' + this.id
					})
				} else {
					this.$router.push({
						path: '/home/addresslist/' + this.id,
						query: {
							from: 'helppay'
						}
					})
				}
			},
			// 新增
			addAction() {
				if (this.isPot == '罐') {
					this.value += 500;
				} else {
					this.value += 20;
				}
				Storage.set('count', this.value);
				Storage.del('addclass');
				this.active = -1;
			},
			//  减少   
			minusdAction() {
				if (this.isPot == '罐') {
					this.value -= 500;
				} else {
					this.value -= 20;
				}
				Storage.set('count', this.value);
				Storage.del('addclass');
				this.active = -1;
			},
			//   立即支付
			keepSave() {
				this.over_payData.orderId = this.superData.id;
				if (this.$route.query.fromView !== 'order') {
					this.payFun()
				} else {
					// 订单未支付状态跳进来支付
					if (!this.isChecked2 && !this.isChecked3) {
						this.$toast({
							message: '请先选择支付方式'
						})
						return
					}
					if (!this.isChecked) {
						this.$tool.toast('请先阅读且同意《友牧农场服务协议》')
						return
					}
					//余额不足
					if (Storage.get('checkedYE') && this.accountMoney < this.superData.orderMoney) {
						this.$tool.toast('账户余额不足请选择其它支付方式');
						return
					}
					if (Storage.get('checkedYE')) {
						this.YEpayoverlay = true;
					} else {
						console.log('微信支付')
						this.wxPayFun(this.over_payData.orderId) //微信支付方法
					}
				}
			},
			// 下单方法
			saveOrderFun() {
				return this.p = new Promise((reslove, reject) => {
					this.$api.post('/api/fungus_order/save', this.postData)
						.then((res) => {
							this.over_payData.orderId = res.data;
							reslove(res)
							if (Storage.get('checkedYE')) {
								this.YEpayoverlay = true;
							}
						})
				})
			},
			// 支付方法
			payFun() {
				if (this.$route.query.fromView !== 'order') {
					if (Object.keys(this.firstList).length == 0) { //  判断对象是否为空
						this.$toast({
							message: '请先添加收货地址'
						})
						return
					}
				}
				// 两个都不选
				if (!this.isChecked2 && !this.isChecked3) {
					this.$toast({
						message: '请先选择支付方式'
					})
					return
				}
				// 没选协议
				if (!this.isChecked) {
					this.$tool.toast('请先阅读且同意《友牧农场服务协议》')
					return
				}
				//  实名认证
				if (this.user.userInfo.idCard == null || this.user.userInfo.idCard == '') { // 判断是否有实名
					this.$tool.toast('请先实名认证')
					setTimeout(() => {
						this.$router.push({
							path: '/my/personalInfo/certification'
						})
					}, 800)
					return
				}
				// 余额不足
				if (Storage.get('checkedYE') && this.accountMoney < this.$store.getters.totalMoney) {
					this.$tool.toast('账户余额不足请选择其它支付方式');
					return
				}

				
				// 余额支付
				if (Storage.get('checkedYE')) {
					// 在vuex拿 isPayPwd 通过user拿   判断是否有设置交易密码  isPayPwd 1 代表有密码
					if (this.user.userInfo.isPayPwd !== 1) {
						// 没有设置交易密码 跳设置交易密码页
						this.$tool.toast('请先设置交易密码')
						setTimeout(() => {
							this.$router.push({
								path: '/my/accountSet/setTradePassword/99'
							})
						}, 800)
						return
					}
					if (this.user.userInfo.isPayPwd == 1) {
						this.saveOrderFun() // 调用下单方法
						return
					}
				} else {
					// 微信支付
					this.saveOrderFun() // 下单方法
					this.p.then((res) => {
						this.wxPayFun(res.data)
					})

				}
			},
			// 余额支付方法
			over_pay() {
				this.$api.post('/api/fungus_order/over_pay', this.over_payData) //POST /api/order/over_pay/{order_id}
					.then((res) => {
						console.log(res)
						if (res.code == 0) {
							this.$router.push({
								path: '/helppoor/status',
								query: {
									data: JSON.stringify(res.data)
								}
							})
						} else if (res.data.code == 20014) { //交易密码错误
							this.over_payData.payPwd = '';
							this.$tool.toast(res.data.message)
						}

					})
			},
			// 微信支付
			wxPayFun(res) {
				// 微信支付接口
				this.$api.post('/api/fungus_order/wx_pay/' + res)
					.then((res) => {
						let resData = JSON.parse(res.data);
						if (resData.package == 'prepay_id=null') {
							this.$toast('登录已过期，请重新登录');
							setTimeout(() => {
								this.$store.commit("userLoginOut");
								this.$router.push('/login')
							}, 800);
							return
						} else {
							WeixinJSBridge.invoke('getBrandWCPayRequest', {
									"appId": resData.appId,
									"timeStamp": resData.timeStamp,
									"nonceStr": resData.nonceStr,
									"package": resData.package,
									"signType": resData.signType,
									"paySign": resData.paySign
								},
								function(res) {
									if (res.err_msg == "get_brand_wcpay_request:ok") {
										window.location.href="http://cs.umubao.com/index.html";
									}
								})
						}

					})
			},
			// 通过这个接口拿 钱包余额
			getUserData() {
				this.$api.get('/api/user/detail')
					.then(({
						data
					}) => {
						this.accountMoney = data.accountMoney; // 钱包余额
					})
			},
			// 物流说明
			meatTips() {
				this.meatTipsFlag = true;
			},
			// 显示购买数量弹框
			onfocus() {
				this.isOverlay = true;
				setTimeout(() => {
					this.$refs['re'].focus(); // 光标聚焦
				}, 200);
				this.amount = '';
			},
			// 隐藏购买数量弹框
			hideOverlay() {
				this.amount = '';
				this.isOverlay = false;
			},
			// 遮罩层确认按钮
			comfirmPrice() {
				if (this.amount == '') {
					this.$toast('数量不能为空')
					return
				} else if (this.amount == 0) {
					this.$toast('数量不能为0')
					this.amount = ''
					return
				} else if (this.amount < this.superData.minOrderQuantity) {
					this.$toast(`请输入有效数值，最低购买量${this.superData.minOrderQuantity}${this.isPot}`)
					this.amount = ''
					return
				} else if (this.amount > this.superData.maxOrderQuantity) {
					this.$toast(`请输入有效数值，最高购买量${this.superData.maxOrderQuantity}${this.isPot}`);
					this.amount = ''
					return
				}
				Storage.set('count', this.amount) // 输入数量时存储，防止刷新消失
				this.value = this.amount;
				this.isOverlay = false;
			},
			// 隐藏余额支付框
			hideKeyborard() {
				this.over_payData.payPwd = '';
				this.YEpayoverlay = false;
			},
			toAgaricPurchaseAgreement() {
				this.$router.push({
					name: 'agaricPurchaseAgreement',
					query: {
						id: -1,
						orderQuantityUnit: this.$route.query.isPot
					}
				})
			}
		},
		beforeDestroy() {
			// 因为可以手动输入数量
			localStorage.setItem('count', Number(this.value))
		}
	}
</script>
<style lang="scss">
	/* 修改配送时间 感叹号 弹出框 */
	.helppay {
		.van-password-input__security li {
			border-right: 1px solid #D0CFCF;

			&:first-child {
				border-left: 1px solid #D0CFCF;
			}

			&:last-child {
				border: red !important;
			}
		}

		.van-password-input__security::after {
			border: 1px solid #D0CFCF;
		}

		.van-stepper__input {
			width: 60px;
		}

		.van-password-input {
			margin: 0;
		}
	}
</style>
<style lang="scss" scoped>
	@import '../pay.scss';

</style>
